<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			* {
				margin: 0;
				padding: 0;
				box-sizing: border-box;
			}

			.boxbig {
				overflow: hidden;
				border: 1px solid green;
				width: 200px;
				height: 200px;
				cursor: pointer;
			}

			li {
				list-style: none;
			}

			ul {
				list-style: none;
				display: flex;
				flex-direction: column;
				justify-content: space-between;
			}

			body {
				display: flex;
				justify-content: center;
				align-items: center;
				height: 100vh;
			}

			li {
				font-size: 20px;
				letter-spacing: 4px;
				border-bottom: 1px solid green;
				margin: 5px 0;
			}
		</style>
	</head>
	<body>
		<div class="boxbig">
			<ul class="ul"></ul>

			<ul class="con"></ul>
		</div>
		<script type="text/javascript">
			const con = document.querySelector(".con")
			const boxbig = document.querySelector(".boxbig")
			const ul = document.querySelector(".ul")
			let data = ['1111111', '22222222', '333333333', '33333333333', '555555555555', '122112122112']
			let str = '',
				time = null
			data.forEach(v => {
				str += `<li>${v}</li>`
			})
			ul.innerHTML = str

			function scrollUp(speed) {
				if (ul.offsetHeight >= con.offsetHeight) {
					con.innerHTML = ul.innerHTML
					time = setInterval(scrol, speed)
					
			boxbig.addEventListener('mouseover',()=>{
						clearInterval(time)
					})
					
					boxbig.addEventListener('mouseleave',()=>{
						time = setInterval(scrol, speed)
					})
					
					function scrol() {
						if (boxbig.scrollTop >= ul.scrollHeight) {
							boxbig.scrollTop = 0
						} else {
							boxbig.scrollTop++
						}
						if (boxbig.scrollTop % 25 == 0) {
							clearInterval(time)
							setTimeout(() => {
								time = setInterval(scrol, speed)

							}, 1)
						}
					}
				}
			}
					
			scrollUp(100)
		</script>
	</body>
</html>
